package com.cuitrip.business.pay;


import android.os.Bundle;
import android.os.Parcelable;
import android.support.annotation.Nullable;
import android.support.v4.app.DialogFragment;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.cuitrip.apiservice.OrderBusiness;
import com.cuitrip.business.notice.model.FeeDescription;
import com.cuitrip.business.pay.adapter.FeeDescriptionAdapter;
import com.cuitrip.business.pay.model.PayMode;
import com.cuitrip.service.R;
import com.lab.app.customui.CustomUiConfig;
import com.lab.app.customui.CustomUiFragment;
import com.lab.component.common.BaseDialogFragment;
import com.lab.network.model.IProxyCallback;
import com.lab.network.model.ProxyResult;
import com.lab.network.proxy.ApiProxy;
import com.lab.rtenvironment.AppCoreRuntime;
import com.lab.utils.Utils;

import java.io.Serializable;
import java.util.ArrayList;

import butterknife.Bind;
import butterknife.ButterKnife;

/**
 * Created by sheena on 15/11/3.
 */
public class PayOrderFeeDescriptionFragment extends CustomUiFragment {

    @Bind(R.id.rv_fee_description)
    RecyclerView rvFeeDesc;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        return super.onCreateView(inflater, container, savedInstanceState,R.layout.fragment_pay_fee_description);
    }

    @Override
    public boolean initCloseTopBar() {
        return true;
    }

    @Override
    public CustomUiConfig initCustomUiConfig() {
        return null;
    }

    @Override
    public void initView() {
        ButterKnife.bind(this,getView());
    }

    @Override
    public void initData() {
        if (getArguments()!=null){
            ArrayList<FeeDescription> notice = getArguments().getParcelableArrayList("notice");
            FeeDescriptionAdapter adapter=new FeeDescriptionAdapter();
            adapter.setDescription(notice);
            LinearLayoutManager layoutManager = new LinearLayoutManager(AppCoreRuntime.context);
            layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
            rvFeeDesc.setLayoutManager(layoutManager);
            rvFeeDesc.setAdapter(adapter);
        }
    }

    public static PayOrderFeeDescriptionFragment newInstance(ArrayList<FeeDescription> notice){
        PayOrderFeeDescriptionFragment payOrderFeeDescriptionFragment=new PayOrderFeeDescriptionFragment();
        Bundle budle=new Bundle();
        budle.putParcelableArrayList("notice", notice);
        payOrderFeeDescriptionFragment.setArguments(budle);
        return payOrderFeeDescriptionFragment;
    }

}
